package com.itheima.Woek02;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class AnnoDemo {
    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException {
        Class<?> clazz = Class.forName("com.itheima.Woek02.workTest");

        workTest test = (workTest) clazz.newInstance();


        Method[] methods = clazz.getDeclaredMethods();

        for (Method method : methods) {


            if (method.isAnnotationPresent(work.class)){
                method.invoke(test);
            }
        }
    }
}
